package com.itheima.shop.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.itheima.shop.entity.Order;

public interface OrderMapper {
	@Insert(value="insert into tab_order(ordertime,total,state,address,name,telephone,uid) values (#{ordertime},#{total},#{state},#{address},#{name},#{telephone},#{user.uid})")
	@Options(useGeneratedKeys = true, keyProperty = "oid")
	public int insert(Order order);
	
	@Update("update tab_order set total = #{total} where oid = #{oid}")
	public int updateTotal(@Param("total")double total,@Param("oid")int oid);
}
